﻿using Architecture.Api.Application.Commands.SlaughterCommand;
using Architecture.Domain.Services.Interface;
using Architecture.Domian.DTO;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.SlaughterHandler
{
    public class SlaughterQuerySlaughterPictureCommandHandler : IRequestHandler<SlaughterQuerySlaughterPictureCommand, List<PictureDTO>>
    {

        private readonly ISlaughterService _slaughterservice;

        public SlaughterQuerySlaughterPictureCommandHandler(ISlaughterService slaughterservice)
        {
            _slaughterservice = slaughterservice;
        }

        public async Task<List<PictureDTO>> Handle(SlaughterQuerySlaughterPictureCommand request, CancellationToken cancellationToken)
        {
            return await _slaughterservice.GetSlaughterPicture(request.productionLot);
        }
    }
}
